<?php $website_url = Configure::read('Website.url'); ?>
<?php
	$login_id = $this->Session->read('Auth.User.id'); 
?>
<div id="main_temp">
  <div class="wrapper">
    <div class="main">
      <div class="logo">
      <a href="<?php echo $website_url;?>" > 
	  	<?php echo $html->image('logo.png', array('width'=>'232', 'height'=>'74', 'alt'=>'')); ?> 
      </a>
      </div>
      <div class="had_right">
        <div class="had_nav">
          <ul>
          
          	<li>
			<?php $session_name = $this->Session->read('Auth.User.name'); 
					if(isset($session_name) and ($session_name)){ 
							//echo $session_name;
							echo $html->link(substr($session_name, 0, 10), array('controller'=>'users', 'action'=>'profile', $this->Session->read('Auth.User.slug')));
					}
					else{  echo "Hi Guest !"; }?>
            </li>
            <li>
               <?php 
			   if(isset($login_id) and ($login_id))
					{
						echo $html->link('Your account', array('controller'=>'users', 'action'=>'dashboard'));
					}
				else
					{
						echo $html->link('Join Free', array('controller'=>'users', 'action'=>'login'));
					}
				?>
            </li>
            <li>
		<?php
			   $user_id = $this->Session->read('Auth.User.id');
			 if((isset($fb_id) and ($fb_id) and sizeof($fb_id)) and (isset($user_id) and ($user_id)))
				 {
							echo"". $facebook->logout(); echo "";
				 }
			 else
				 {
					 $user_id = $this->Session->read('Auth.User.id');
					 if(isset($user_id) and ($user_id))
						 {
							 echo "";
							 echo $this->Html->link('Sign Out', array('controller'=>'users', 'action'=>'logout'));
							 echo "";
						 }
						 else{
							 echo $html->link('Login', array('controller'=>'users', 'action'=>'login'));
						 }
				 }
		?> 
            </li>
            <li><a href="#">Community</a></li>
            <li><a href="#">Help</a></li>
            
          </ul>
        </div>
        <div class="had_right_in"> 
			<?php echo $html->image('right.png', array('width'=>'28', 'height'=>'30', 'alt'=>'')); ?> Wondere Buyer Protection
         </div>
      </div>
    </div>
    <div class="clear"></div>
  </div>
  <div class="hadder_bot">
    <div class="wrapper">
      <div class="hadder_bot1">
         <?php echo $form->create('Product', array('action'=>"search", 'id'=>'search')) ?>

        <?php echo $this->Form->input('Category.search',  array('type' => 'text','class'=>'field','label' =>false)); ?>
				<?php 
                if(isset($Seach_categories) and ($Seach_categories))
                    {
                        $Seach_categories = $Seach_categories;
                        $Seach_categories['0']= $Seach_categories['0'];
                    }
                else
                    {
                        $Seach_categories = "";
                        $Seach_categories['0'] ="";
                    }
                echo $this->Form->input('Category.id', 
                array('type' => 'select','options'=>$Seach_categories,
                'default'=>$Seach_categories['0'],'class'=>'select','empty'=>false,'label' =>false)
                );
                ?>
            <input name="" type="submit" value="search" class="sea_btn" />
        </form>
        <?php echo $html->link('Advanced Search',array('controller'=>'products', 'action'=>'advancesearch') , array('class'=>'advance_search')); ?>
        <?php echo $html->link('WishList', array('controller'=>'products', 'action'=>'MyWishlist'), array('class'=>'wishlink')); ?>
        <a href="<?php echo $website_url;?>products/cart/view" class="cartlink"> 
        Cart
           (
            <?php if(isset($count_cart) and ($count_cart))
                    {
                        echo $count_cart;
                    }
                    else
                    {
                        echo '0';
                    }
            ?>
            ) Items
          </a>
          </div>
    </div>
  </div>
</div>
